package com.pl.service.Impl;

import com.pl.entity.ScoreTb;
import com.pl.dao.ScoreTbDao;
import com.pl.entity.SysUser;
import com.pl.service.ScoreTbService;
import org.springframework.stereotype.Service;
import org.springframework.beans.factory.annotation.Autowired;

import javax.servlet.http.HttpSession;
import java.util.List;
import java.util.Map;

/**
 * (ScoreTb)表服务实现类
 *
 * @author makejava
 * @since 2024-04-26 14:42:45
 */
@Service("scoreTbService")
public class ScoreTbServiceImpl implements ScoreTbService {
    @Autowired
    private ScoreTbDao scoreTbDao;

    /**
     * 通过ID查询单条数据
     *
     * @param sid 主键
     * @return 实例对象
     */
    @Override
    public ScoreTb queryById(Object sid) {
        return this.scoreTbDao.queryById(sid);
    }
    /**
     * 分页查询
     *
     * @return 查询结果
     */
    @Override
    public List<ScoreTb> queryByPage(Map<String, Object> map) {

        return scoreTbDao.queryByPage(map);
    }


    /**
     * 新增数据
     *
     * @param scoreTb 实例对象
     * @return 实例对象
     */
    @Override
    public boolean insert(ScoreTb scoreTb) {

        int insert = this.scoreTbDao.insert(scoreTb);
        if (insert>0){
            return true;
        }
        return false;
    }

    /**
     * 修改数据
     *
     * @param scoreTb 实例对象
     * @return 实例对象
     */
    @Override
    public boolean update(ScoreTb scoreTb) {
        int update = this.scoreTbDao.update(scoreTb);
        if (update>0){
            return true;
        }
        return false;
    }

    /**
     * 通过主键删除数据
     *
     * @param sid 主键
     * @return 是否成功
     */
    @Override
    public boolean deleteById(int sid) {
        return this.scoreTbDao.deleteById(sid) > 0;
    }

    /**
     * 批量删除
     * @param list
     * @return
     */
    @Override
    public boolean deleteBatch(List<Integer> list) {
        int num=scoreTbDao.deleteBatch(list);
        if (num>0){
            return true;
        }
        return false;
    }
}
